module ins_decode (
        input en,     
        input [3:0] ir,
        output reg mova,
        output reg movb,
        output reg movc,
        output reg movd,
        output reg add,
        output reg sub,
        output reg jmp,
        output reg jg,
        output reg in1,
        output reg out1,
        output reg movi,
        output reg halt
    );
    // parameter MOV = 4'b01xx,ADD = 4'b1000,SUB = 4'b1001,JMP = 4'b1010,IN = 4'b1100,OUT = 4'b1101,HALT = 4'b1111,movi=1110;
    always @(*) begin
        {mova,movb,movc,movd,add,sub,jmp,jg,in1,out1,movi,halt} = 0;
        if (en) begin
            case(ir[3:0])
                4'b0100: 
                    mova = 1'b1;
                4'b0101:
                    movb = 1'b1; 
                4'b0110: 
                    movc = 1'b1;
                4'b0111: 
                    movd = 1'b1;            
                4'b1000: 
                    add = 1'b1;
                4'b1001:
                    sub = 1'b1;
                4'b1010:
                    jmp = 1'b1;
                4'b1011:
                    jg = 1'b1;
                4'b1100:
                    in1 = 1'b1;
                4'b1101:
                    out1 = 1'b1;
                4'b1110:
                    movi = 1'b1;    
                4'b1111:
                    halt = 1'b1;
                default:
                    ;
            endcase
        end
    end
endmodule